//
// Created by yonghu0 on 25-11-2.
//

#ifndef REDISDATABASE_H
#define REDISDATABASE_H

#include <sw/redis++/redis++.h>
using namespace sw::redis;

class ReDB
{
public:
    static ReDB *GetInstance();

    bool SetToken(std::string token, std::string id);
    std::string GetUserIdByToken(std::string token);

    bool AddProblemCache(std::string problemid, std::string probleminfo);
    std::string GetProblemCache(std::string problemid);
    bool DeleteProblemCache(std::string problemid);

    bool AddStatusRecordCache(std::string statusrecordid, std::string statusrecordinfo);
    std::string GetStatusRecordCache(std::string statusrecordid);

private:
    Redis *m_redis_token;
    Redis *m_redis_cache;

    ReDB();
    ~ReDB();
};


#endif //REDISDATABASE_H
